package com.shrct.businessprocess.purchase;

import com.shrct.businessprocess.diagnose.IDiagnoseAcceptor;
import com.shrct.businessprocess.product.RCProductEntry;
import com.shrct.businessprocess.product.RCProductSpecification;
import com.shrct.businessprocess.project.RCExchangeRate;
import com.shrct.businessprocess.project.RCProjectMoney;
import com.shrct.businessprocess.purchase.IHasAcceptedProducts;
import com.shrct.businessprocess.purchase.RCBaseProductPurchaseBudget;
import com.shrct.businessprocess.purchase.RCBasePurchaseRequest;
import com.shrct.businessprocess.purchase.RCProductPurchaseRequestItem;
import com.shrct.businessprocess.purchase.RCPurchaseOrder;
import com.shrct.businessprocess.purchase.impl.RCProductPurchaseRequestImpl;
import com.shrct.businessprocess.purchase.proxy.RCProductPurchaseRequestProxy;
import edu.fudan.mylang.pf.EntityImplementation;
import java.util.Collection;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@EntityImplementation(implementBy = RCProductPurchaseRequestImpl.class)
public interface RCProductPurchaseRequest extends RCBasePurchaseRequest, IHasAcceptedProducts {
  public abstract Collection<RCProductPurchaseRequestItem> getItems();
  
  public abstract RCProductPurchaseRequestItem createAndAddtoItems();
  
  public abstract RCProductPurchaseRequestItem createAndAddtoItems(final Procedure1<RCProductPurchaseRequestItem> updater);
  
  public abstract RCProductPurchaseRequest removeFromItems(final RCProductPurchaseRequestItem rCProductPurchaseRequestItem);
  
  public abstract RCProductPurchaseRequest removeAllItems();
  
  public abstract Collection<RCPurchaseOrder> getPurchaseOrders();
  
  public abstract RCPurchaseOrder createAndAddtoPurchaseOrders();
  
  public abstract RCPurchaseOrder createAndAddtoPurchaseOrders(final Procedure1<RCPurchaseOrder> updater);
  
  public abstract RCProductPurchaseRequest removeFromPurchaseOrders(final RCPurchaseOrder rCPurchaseOrder);
  
  public abstract RCProductPurchaseRequest removeAllPurchaseOrders();
  
  public abstract RCBaseProductPurchaseBudget getBudget();
  
  /**
   * 计算是否所有请购的内容都已经订购
   */
  public abstract Boolean calcIsOrderFinished();
  
  public abstract RCPurchaseOrder createOrder();
  
  public abstract void deleteOrder(final RCPurchaseOrder o);
  
  public abstract Integer getTotalOrderItemsQuantity();
  
  public abstract Integer getTotalPassedOrderItemsQuantity(final RCProductSpecification productSpec);
  
  public abstract Integer getTotalOrderItemsQuantity(final RCProductSpecification productSpec);
  
  public abstract Integer getTotalAcceptItemsQuantity();
  
  public abstract Integer getTotalAcceptItemsQuantity(final RCProductSpecification productSpec);
  
  public abstract RCProjectMoney getTotalOrderAmount();
  
  public abstract RCProjectMoney getTotalPessimisticOrderAmount();
  
  public abstract RCProjectMoney getTotalRequestedAmount();
  
  public abstract RCExchangeRate getExchangeRate();
  
  public abstract void diagnose(final IDiagnoseAcceptor acceptor);
  
  public abstract Iterable<RCProductEntry> getAllAcceptedProducts();
  
  public abstract void auditPassed();
  
  public abstract RCProductPurchaseRequestProxy toProxy();
}
